package com.zretc.controller;

import com.github.pagehelper.PageInfo;
import com.zretc.entity.Screening;
import com.zretc.service.ScreeningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 周文涛
 * 前端场次安排显示
 */
@RestController
@RequestMapping("front")
public class FrontScreeningController {

    @Autowired
    private ScreeningService screeningService;

    @GetMapping("screening")
    public PageInfo<Screening> getScreeningList(String pageNum,
                                                String pageSize){
        Map<String,String> condition = new HashMap<String,String>();
        condition.put("pageNum",pageNum);
        condition.put("pageSize",pageSize);
        condition.put("startTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        return screeningService.getScreeningList(condition);
    }
}
